package com.csq.androidproject.views.calendarview.caldroid.views;

import android.content.Context;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.GridView;

import com.csq.androidproject.R;
import com.csq.androidproject.utils.DensityUtil;

public class PageGridView extends GridView {
    
    public PageGridView(Context context) {
        super(context);
        
        setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 
            ViewGroup.LayoutParams.MATCH_PARENT));
        setGravity(Gravity.CENTER);
        setNumColumns(7);
        setStretchMode(STRETCH_COLUMN_WIDTH);
        
        setBackgroundColor(getResources().getColor(R.color.caldroid_lighter_gray));
        
        int dip1 = DensityUtil.dip2px(getContext(), 1);
        setVerticalSpacing(dip1);
        setHorizontalSpacing(dip1);
        
        setPadding(dip1, dip1, dip1, dip1);
        
        setHorizontalScrollBarEnabled(false);
        setVerticalScrollBarEnabled(false);
    }
    
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // TODO Auto-generated method stub
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

}
